package cn.bitkit.tools.data;

import com.alibaba.fastjson2.JSON;

import java.util.List;

/**
 * 
 * @author changbo
 *
 */
public class BeanUtil {

	public static <T> T convert(Object source, Class<T> clazz) {
		return JSON.parseObject(JSON.toJSONString(source), clazz);
	}
	
	public static <T> List<T> convertList(List<?> list, Class<T> clazz){
		return JSON.parseArray(JSON.toJSONString(list), clazz);
	} 
	
}
